import request from '@/utils/request';

// 查询关键系统TOP5
export function queryKeySystemTop5(data?: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/system',
		method: 'post',
		data: {
			status: 1,
			isKey: 1,
			pageNum: 1,
			pageSize: 5,
			orderByColumn: 'sequence',
		},
		headers: {
			VERSION: 'dengfazhu',
		},
	});
}

// 查询全系统总览
export function querySystemOverview(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/system/querySystemOverview',
		method: 'post',
		params: data,
		headers: {
			'Content-Type': 'application/json',
		},
	});
}

// 系统健康度,平均处理时长,告警请求量趋势图
export function querySystemTrendList(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/system/querySystemTrendList',
		method: 'post',
		params: data,
		headers: {
			VERSION: 'lishilei',
		},
	});
}

// 全系统总览下载
export function exportSystemList(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/system/downloadSystemOverview',
		method: 'post',
		data: data,
		responseType: 'blob',
	});
}

// 系统监控详情 健康度
export function querySystemStatisticsDetail(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/system/querySystemStatisticsDetail',
		method: 'post',
		data: data,
		headers: {
			VERSION: 'lishilei',
		},
	});
}

// 系统监控详情  用户数
export function queryUserNum(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/system/queryUserNum',
		method: 'post',
		data: data,
	});
}

// 系统监控详情  异常用户数
export function queryExceptionUserNum(data: any) {
	return request({
		url: '/business-monitor/system/queryExceptionUserNum',
		method: 'post',
		data: data,
	});
}
